package sample.swagger.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Api：类的注解
 * value:类似于ID
 * tags：该API所属分组（可以属多个分组）
 */
@Api(value="A Test Controller",tags = {"test service"})
@RestController
public class TestController {

    /**
     * @ApiOperation：方法的解释、提示
     * @ApiParam：参数的解释、提示
     * @return
     */
    @ApiOperation(value="A Method That Repeat What u request",notes="i m the note.")
    @RequestMapping(value="/hello",method = RequestMethod.POST)
    public String hello(@ApiParam(value="Thing u request" ,required = true)
                                    @RequestParam(value="str") String str){
        System.out.println(str);
        return str;
    }
}
